<?php

namespace App\Models;

use App\Traits\UseMeter;
use App\Traits\UseOwner;
use Illuminate\Database\Eloquent\Model;

// 房产
class House extends Model implements Estate
{
    use UseOwner, UseMeter;

    protected $fillable = [
        'name',
        'address',
        'description',
        'image',
        'is_rent'
    ];

    protected $casts = [
        'address' => 'json',
        'is_rent' =>  'boolean'
    ];

    public function buildings()
    {
        return $this->hasMany(Building::class);
    }
}
